#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

bool isCircle(string s)
{
    int i = 0, j = s.size() - 1;
    while (i < j)
    {
        if (s[i] != s[j]) return false;
        i++;
        j--;
    }
    return true;
}

int main()
{
    string s1, s2;
    cin >> s1;
    cin >> s2;
    int count = 0;
    for (int i = 0; i <= s1.size(); i++)
    {
        string str = s1;
        str.insert(i, s2);
        if (isCircle(str)) count++;
    }
    cout << count;
    return 0;
}